from time import sleep
from threading import Thread


class Accout(object):
    __slots__ = ('_Money', '_balance')

    def __init__(self):
        self._balance = 0

    def deposit(self, money):
        new_balance = self._balance + money
        sleep(0.01)
        self._balance = new_balance

    @property
    def balance(self):
        return self._balance


class Text(Thread):
    def __init__(self, account, money):
        super().__init__()
        self._acconut = account
        self._money = money

    def run(self):
        self._acconut.deposit(self._money)
    

def mian():
    account = Accout()
    thread = []
    for _ in range(1000):
        t = Text(account, 1)
        thread.append(t)
        t.start()
    for t in thread:
        t.join()
    print('账户余额为: ￥%d元' % account.balance)